package com.szpx.controller.ZRZController;

import com.szpx.entity.ZRZ.guanliyuanXX;
import com.szpx.service.guanliyuanXXService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * 1.测试前端使用Ajax向后台发送JSON数据，后台接收到数据。
 * 2.后台使用JSON解析前端传过来的数据后返回JSON数据给前端展示。
 */
@Controller
@RequestMapping("/zrz")
public class guanliyuanXXController {
    @Autowired
    private guanliyuanXXService guanliyuanXXService;

    @RequestMapping("/guanliyuanXXLayui")
    public String userHuiHuiTestLayui(HttpSession session, Model model) {
        List<guanliyuanXX> guanliyuanXXList = guanliyuanXXService.selectAllguanliyuanXX();
        System.out.println(guanliyuanXXList.toString());
        model.addAttribute("hi",guanliyuanXXList);
//        D:\demo\src\main\resources\templates\lishihuiTeacherHtml\lishihuiAjaxHtml\huihui.html
        return "ZRZ/guanliyuanXX.html";
    }

   
    /*@RequestMapping("/add")
    public String addDeliveryPage() {
        return "ZRZ/guanliyuanXXadd.html";
    }

    @RequestMapping("/save")
    public String saveDString(Delivery delivery) {
        deliveryService.saveDelivery(delivery);
        return "redirect:/delivery/list";
    }

    @RequestMapping("/edit")
    public String editDeliveryPage(int id, Model model,HttpSession session) {
        model.addAttribute("delivery", deliveryService.getDeliverytById(id));
        return "ZRZ/guanliyuanXXedit.html";
    }

    @RequestMapping("/update")
    public String updateDelivery(Delivery delivery) {
        deliveryService.updateDelivery(delivery);
        return "redirect:/delivery/list";
    }
*/

}
